<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/21
 * Time: 11:47
 */
class Student
{
    public $name;
    public $sex;
    public $age;
    static $num=0;


    function introduce()
    {
        echo "我是".$this->name.",".$this->sex.","."我".$this->age."岁<br>";
    }

    function __construct($name,$sex,$age)
    {
        $this->name=$name;
        $this->sex=$sex;
        $this->age=$age;
        Student::$num++;
        echo $this->name."加入PHP，当前有".Student::$num."个学生<br>";
    }

    function __destruct()
    {
        echo $this->name."学到放弃了<br>";
    }

}